<form role="form" data-toggle="validator" class="form-horizontal">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">{:__('商品名称')}:</label>
        <div class="col-xs-12 col-sm-9">
            <p class="form-control-static">{$row.name|htmlentities}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">{:__('未通过原因')}:</label>
        <div class="col-xs-12 col-sm-9">
            <div class="well well-sm" style="background-color: #f8f8f8; border: 1px solid #e7e7e7; min-height: 80px; padding: 15px;">
                {if condition="$row.reject_reason"}
                    <p class="text-danger" style="margin: 0; line-height: 1.6; font-size: 14px;">{$row.reject_reason|htmlentities}</p>
                {else/}
                    <p class="text-muted" style="margin: 0;">暂无拒绝原因</p>
                {/if}
            </div>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-3"></label>
        <div class="col-xs-12 col-sm-9">
            <button type="button" class="btn btn-primary" onclick="closeLayer()">{:__('关闭')}</button>
        </div>
    </div>
</form>

<script>
function closeLayer() {
    // 尝试多种方式关闭弹窗
    try {
        if (typeof parent.layer !== 'undefined') {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        } else if (typeof layer !== 'undefined') {
            layer.closeAll();
        } else if (window.parent && window.parent !== window) {
            window.parent.postMessage('closeLayer', '*');
        }
    } catch (e) {
        console.log('关闭弹窗失败:', e);
        // 最后尝试关闭窗口
        if (window.parent && window.parent !== window) {
            window.parent.location.reload();
        }
    }
}
</script>